<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var str = "我寄秋风,与明月";

    var index = str.indexOf("秋");
    var index2 = str.indexOf("与");

    var child = str.slice(index + 1, index2);
    document.write(child);
    console.log(child);
</script>
</html>